<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>
    <style>
        .sty01{
            background: red;
        }
    </style>
</head>
<body>
    <div id="root"></div>

    <script type="text/babel">
        let iNum = 10;
        let sTr = 'ad';
        let ok = true;
        let url = 'http://www.baidu.com/';
        function fnRes(s) {
            return s.split('').reverse().join('');
        }
        let e1 = (
        <div>

            <h1> 这是h1</h1>

            {/* 插入变量及运算*/}
            <p>{iNum + 5}</p>

            {/*插入表达式*/}
            <p>{ sTr.split('').reverse().join('') }</p>

            {/*插入函数调用*/}
            <p>{ fnRes(sTr)}</p>

            {/*插入三元运算表达式*/}
            <p>{ ok?'yes':'No' }</p>

            <a href={url} className="sty01">这是一个变量</a>
        </div>
        );
        ReactDOM.render(
            e1,
            document.getElementById('root'),
        )
    </script>
</body>
</html>